import struct
from socket import *

# print(len("test.png"))

# sendData = struct.pack("!H8sb5sb",1,"test.png".encode('gb2312'),0,b"octet",0)
sendData = struct.pack("!H8sb5sb",1,b"test.pdf",0,b"octet",0)

udpSocket = socket(AF_INET, SOCK_DGRAM)

ip = '192.168.131.58'
port = 69
udpSocket.sendto(sendData, (ip, port))

udpSocket.close()